package com.credit.util;

import java.math.BigDecimal;
import java.util.Date;

import com.credit.entity.CreditCoinRecord;
import com.credit.entity.CreditPointsRecord;
import com.credit.service.CreditCoinService;
import com.credit.service.CreditPointsService;

public class CoinUtil {
	
	
	public static void addCoinRecord(String useType,Long userId, int coin, String name,BigDecimal amount) {
		
		CreditCoinService creditCoinService = (CreditCoinService) ApplicationContextUtils.getBean("creditCoinService");
		CreditCoinRecord coinRecord = new CreditCoinRecord();
		coinRecord.setCreateTime(new Date());
		coinRecord.setName(name);
		coinRecord.setNumber(coin);
		coinRecord.setUserId(userId);
		coinRecord.setUseType(useType);
		coinRecord.setMoney(amount);
		creditCoinService.addCoinRecord(coinRecord);
	}

}
